package com.study;

import com.study.listener.ApplicationReadyEventListener;
import com.study.listener.ContextPreparedEventListener;
import com.study.listener.ContextStartedEventListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;


@SpringBootApplication
@EnableAsync
public class EventApp {

    public static void main(String[] args) {

        SpringApplication application = new SpringApplication(EventApp.class);

        application.addListeners( new ApplicationReadyEventListener());
        application.addListeners( new ContextPreparedEventListener());
        application.addListeners( new ContextStartedEventListener());

        ConfigurableApplicationContext run = application.run(args);
    }
}
